const mongoose = require('mongoose')
const schema = new mongoose.Schema(
  {
    title: { type: String, required: true },
    playNum: { type: Number, required: true },
    danmu: { type: Number, required: true },
    img: { type: String, required: true },
    category: { type: mongoose.Schema.Types.ObjectId, ref: 'Category' },
  },
  { timestamps: { createdAt: 'created', updatedAt: 'updated' } }
)

module.exports = mongoose.model('Video', schema)
